// 导入Village脚本
import village from "./Village";
const {ccclass, property} = cc._decorator;

@ccclass
export default class Player_Village extends cc.Component {

    @property({displayName: "Village脚本所在节点", tooltip: "Village脚本所在节点", type: village})
    village: village = null;

    // 物理碰撞回调
    onBeginContact(contact/*碰撞*/:cc.PhysicsContact,selfCollider/*被碰撞*/:cc.PhysicsCollider,otherConllider/*另一个碰撞体*/:cc.PhysicsCollider):void{
        console.log("角色到达了地面，启用按钮");
        // 如果角色落地了
        if (otherConllider.node.group == "groud") {
            // 可以跳跃
            this.village.is_jump_OK = true;
        }
        // 只在两个碰撞体开始接触时调用一次
    }

}
